package io.renren.modules.blog.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.modules.blog.dao.BlogBannerDao;
import io.renren.modules.blog.dto.BlogBannerDTO;
import io.renren.modules.blog.entity.BlogBannerEntity;
import io.renren.modules.blog.service.BlogBannerService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * BANNER
 *
 * @author www.jianglongwang.com wangjianglong126@126.com
 * @since 2.0.0 2020-05-21
 */
@Service
public class BlogBannerServiceImpl extends CrudServiceImpl<BlogBannerDao, BlogBannerEntity, BlogBannerDTO> implements BlogBannerService {

    @Override
    public QueryWrapper<BlogBannerEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");

        QueryWrapper<BlogBannerEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotBlank(id), "id", id);

        return wrapper;
    }


}